/*
 * XML Type:  XCheckBoxList
 * Namespace: http://www.seedwill.com/xul/widget/
 * Java type: com.seedwill.xul.widget.XCheckBoxList
 *
 * Automatically generated - do not modify.
 */
package com.seedwill.xul.widget.impl;
/**
 * An XML XCheckBoxList(@http://www.seedwill.com/xul/widget/).
 *
 * This is a complex type.
 */
public class XCheckBoxListImpl extends com.seedwill.xul.widget.impl.XInputImpl implements com.seedwill.xul.widget.XCheckBoxList
{
    private static final long serialVersionUID = 1L;
    
    public XCheckBoxListImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName CHECKBOX$0 = 
        new javax.xml.namespace.QName("", "checkbox");
    private static final javax.xml.namespace.QName CHECKEDINDEX$2 = 
        new javax.xml.namespace.QName("", "checkedIndex");
    
    
    /**
     * Gets array of all "checkbox" elements
     */
    public com.seedwill.xul.widget.XCheckBox[] getCheckboxArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(CHECKBOX$0, targetList);
            com.seedwill.xul.widget.XCheckBox[] result = new com.seedwill.xul.widget.XCheckBox[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "checkbox" element
     */
    public com.seedwill.xul.widget.XCheckBox getCheckboxArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.widget.XCheckBox target = null;
            target = (com.seedwill.xul.widget.XCheckBox)get_store().find_element_user(CHECKBOX$0, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "checkbox" element
     */
    public int sizeOfCheckboxArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(CHECKBOX$0);
        }
    }
    
    /**
     * Sets array of all "checkbox" element
     */
    public void setCheckboxArray(com.seedwill.xul.widget.XCheckBox[] checkboxArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(checkboxArray, CHECKBOX$0);
        }
    }
    
    /**
     * Sets ith "checkbox" element
     */
    public void setCheckboxArray(int i, com.seedwill.xul.widget.XCheckBox checkbox)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.widget.XCheckBox target = null;
            target = (com.seedwill.xul.widget.XCheckBox)get_store().find_element_user(CHECKBOX$0, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(checkbox);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "checkbox" element
     */
    public com.seedwill.xul.widget.XCheckBox insertNewCheckbox(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.widget.XCheckBox target = null;
            target = (com.seedwill.xul.widget.XCheckBox)get_store().insert_element_user(CHECKBOX$0, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "checkbox" element
     */
    public com.seedwill.xul.widget.XCheckBox addNewCheckbox()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.widget.XCheckBox target = null;
            target = (com.seedwill.xul.widget.XCheckBox)get_store().add_element_user(CHECKBOX$0);
            return target;
        }
    }
    
    /**
     * Removes the ith "checkbox" element
     */
    public void removeCheckbox(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(CHECKBOX$0, i);
        }
    }
    
    /**
     * Gets array of all "checkedIndex" elements
     */
    public int[] getCheckedIndexArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(CHECKEDINDEX$2, targetList);
            int[] result = new int[targetList.size()];
            for (int i = 0, len = targetList.size() ; i < len ; i++)
                result[i] = ((org.apache.xmlbeans.SimpleValue)targetList.get(i)).getIntValue();
            return result;
        }
    }
    
    /**
     * Gets ith "checkedIndex" element
     */
    public int getCheckedIndexArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(CHECKEDINDEX$2, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target.getIntValue();
        }
    }
    
    /**
     * Gets (as xml) array of all "checkedIndex" elements
     */
    public org.apache.xmlbeans.XmlInt[] xgetCheckedIndexArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(CHECKEDINDEX$2, targetList);
            org.apache.xmlbeans.XmlInt[] result = new org.apache.xmlbeans.XmlInt[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets (as xml) ith "checkedIndex" element
     */
    public org.apache.xmlbeans.XmlInt xgetCheckedIndexArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlInt target = null;
            target = (org.apache.xmlbeans.XmlInt)get_store().find_element_user(CHECKEDINDEX$2, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return (org.apache.xmlbeans.XmlInt)target;
        }
    }
    
    /**
     * Returns number of "checkedIndex" element
     */
    public int sizeOfCheckedIndexArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(CHECKEDINDEX$2);
        }
    }
    
    /**
     * Sets array of all "checkedIndex" element
     */
    public void setCheckedIndexArray(int[] checkedIndexArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(checkedIndexArray, CHECKEDINDEX$2);
        }
    }
    
    /**
     * Sets ith "checkedIndex" element
     */
    public void setCheckedIndexArray(int i, int checkedIndex)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(CHECKEDINDEX$2, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.setIntValue(checkedIndex);
        }
    }
    
    /**
     * Sets (as xml) array of all "checkedIndex" element
     */
    public void xsetCheckedIndexArray(org.apache.xmlbeans.XmlInt[]checkedIndexArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(checkedIndexArray, CHECKEDINDEX$2);
        }
    }
    
    /**
     * Sets (as xml) ith "checkedIndex" element
     */
    public void xsetCheckedIndexArray(int i, org.apache.xmlbeans.XmlInt checkedIndex)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlInt target = null;
            target = (org.apache.xmlbeans.XmlInt)get_store().find_element_user(CHECKEDINDEX$2, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(checkedIndex);
        }
    }
    
    /**
     * Inserts the value as the ith "checkedIndex" element
     */
    public void insertCheckedIndex(int i, int checkedIndex)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = 
                (org.apache.xmlbeans.SimpleValue)get_store().insert_element_user(CHECKEDINDEX$2, i);
            target.setIntValue(checkedIndex);
        }
    }
    
    /**
     * Appends the value as the last "checkedIndex" element
     */
    public void addCheckedIndex(int checkedIndex)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(CHECKEDINDEX$2);
            target.setIntValue(checkedIndex);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "checkedIndex" element
     */
    public org.apache.xmlbeans.XmlInt insertNewCheckedIndex(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlInt target = null;
            target = (org.apache.xmlbeans.XmlInt)get_store().insert_element_user(CHECKEDINDEX$2, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "checkedIndex" element
     */
    public org.apache.xmlbeans.XmlInt addNewCheckedIndex()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlInt target = null;
            target = (org.apache.xmlbeans.XmlInt)get_store().add_element_user(CHECKEDINDEX$2);
            return target;
        }
    }
    
    /**
     * Removes the ith "checkedIndex" element
     */
    public void removeCheckedIndex(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(CHECKEDINDEX$2, i);
        }
    }
}
